﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Approval.aspx.cs" Inherits="PersonReimbursement.Approval" %>

<%@ Register Src="../../Processes/ProcessControl/UserInfo_TY.ascx" TagName="UserInfo"
    TagPrefix="ui" %>
<%@ Register Src="../../Processes/ProcessControl/ApprovalHistory_TY.ascx" TagName="ApprovalHistory"
    TagPrefix="ah" %>
<%@ Register Src="../../Processes/ProcessControl/Attachments_TY.ascx" TagName="Attachments"
    TagPrefix="attach" %>
<%@ Register Src="../../Processes/ProcessControl/ButtonList_TY.ascx" TagName="ButtonList"
    TagPrefix="btn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>个人费用报销</title>
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <script src="../../js/common.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {

            var sum = $("#fld_BXJE").text();
            $("#fld_BXJEDX").text(ChangeRMBToCH(sum.toString()));
            $("#fld_BXJE").text(commafy(sum.toString()));
            getSumJE();
        });
        function getSumJE() {
            
            $("#tbDetail tr:gt(0)").each(function (i, Etr) {
                var JE = $(Etr).find("td:eq(6)").children().text();
                //alert(parseFloat(JE).toFixed(2));
                JE = commafy(parseFloat(JE));
                $(Etr).find("td:eq(6)").children().text(JE);
            });
        }

        function commafy(s) {
            //alert(s);
            var j = 0;
            var str = new Array();
            str = s.toString().split(".");
            //alert(str[0]);
            var value = "";
            for (var i = str[0].length - 1; i >= 0; i--) {
                if (j >= 3) {
                    value = str[0][i] + "," + value;
                    j = 0;
                }
                else {
                    value = str[0][i] + value;
                }
                j++;

            }
            //alert(value);
            if (str[1] != undefined) {
                value = value + ".";
                j = 0;
                for (var i = 0; i < str[1].length; i++) {
                    if (j >= 3) {
                        value = value + "," + str[1][i];
                        j = 0;
                    }
                    else {
                        value = value + str[1][i];
                    }
                    j++;
                }
            }
            return value;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="row">
            <ui:userinfo id="UserInfo1" readonly="true" processtitle="个人费用报销" processprefix="CIE"
                tablename="PROC_PERSONREIMBURSEMENT" tablenamedetail="PROC_PERSONREIMBURSEMENT_DT"
                runat="server"></ui:userinfo>
        </div>
        <div class="row">
            <table class="table table-condensed table-bordered">
                <tr>
                    <td class="banner" colspan="4">
                        详细信息
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        所属项目：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="fld_SSXM" runat="server"></asp:Label>
                    </td>
                    <td class="td-label">
                        编号：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="fld_BH" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        报销金额：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="fld_BXJE" runat="server" Text=""></asp:Label>
                    </td>
                    <td class="td-label">
                        报销金额大写：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="fld_BXJEDX" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        账户名：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="fld_ZHM" runat="server"></asp:Label>
                    </td>
                    <td class="td-label">
                        开户行：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="fld_KHH" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        银行卡号：
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:Label ID="fld_YHKH" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        任务完成情况概述：
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:Label ID="fld_WCQKGS" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="10">
                        <table class="table table-condensed table-bordered" id="tbDetail">
                            <tr>
                                <th style="width:10%;">
                                    黏贴单编号
                                </th>
                                <th style="width:10%;">
                                    票据编号
                                </th>
                                <th style="width:10%;">
                                    起始时间
                                </th>
                                <th style="width:10%;">
                                    结束时间
                                </th>
                                <th style="width:10%;">
                                    类型
                                </th>
                                <th style="width:10%;">
                                    票据内容
                                </th>
                                <th style="width:10%;">
                                    金额
                                </th>
                                <th style="width:30%;">
                                    备注
                                </th>
                                <th style="display: none">
                                    编号
                                </th>
                            </tr>
                            <asp:Repeater ID="fld_detail_PROC_PERSONREIMBURSEMENT_DT" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:Label ID="fld_FORMID" Text='<%#Eval("FORMID") %>' runat="server" Style="display: none"></asp:Label>
                                            <asp:Label ID="fld_NDDBH" Text='<%#Eval("NDDBH") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="fld_PJBH" Text='<%#Eval("PJBH") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="fld_STARTDATE" Text='<%#Eval("STARTDATE") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="fld_ENDDATE" Text='<%#Eval("ENDDATE") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="fld_LX" Text='<%#Eval("LX") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="fld_PJNR" Text='<%#Eval("PJNR") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="fld_JE" Text='<%#Eval("JE") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="fld_BZ" Text='<%#Eval("BZ") %>' runat="server" Width="90%"></asp:Label>
                                        </td>
                                        <td style="display: none;">
                                            <asp:TextBox ID="fld_IDNO" Text='<%# Eval("IDNO") %>'  runat="server" Style="display: none;"></asp:TextBox>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <div class="row">
            <attach:attachments id="Attachments1" readonly="true" runat="server"></attach:attachments>
        </div>
        <div class="row">
            <ah:approvalhistory id="ApprovalHistory1" runat="server"></ah:approvalhistory>
        </div>
        <div class="row">
        </div>
    </div>
    <btn:buttonlist id="ButtonList1" runat="server"></btn:buttonlist>
    <div style="display: none;">
    </div>
    </form>
</body>
</html>
